﻿using Pattern17状态模式.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern17状态模式.Models
{
    public class Board : IContext
    {
        private IState _state;
        public IState State => _state;
        public string SubBoard { get ; set ; }

        public Board(IState state, string subBoard)
        {
            _state = state;
            SubBoard = subBoard;
        }

        public void Request()
        {
            _state.Handle(this);
        }

        public void SetState(IState state)
        {
            _state = state;
        }
    }
}
